package chap3.Task;
import java.util.Scanner;
public class Task9 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入税前工资:");
        double a = input.nextDouble();
        double tax;
        if (a >= 15000) {
            tax = (a - 15000) * 0.15 + 7000 * 0.1 + 4500 * 0.5;
        } else if (a >= 8000) {
            tax = (a - 8000) * 0.1 + 4500 * 0.5;
        } else if (a >= 3500) {
            tax = (a - 3500) * 0.5;
        } else {
            tax = 0;
        }
        System.out.println("交税为:"+tax+"\n税后工资为:"+(a-tax));
    }
}

